﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Product.Master" Inherits="System.Web.Mvc.ViewPage<QuestionViewModels>" %>

<%@ Import Namespace="SDT.Lib.Paging" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">   
    <%=Model.Category != null ? Html.Encode(Model.Category.Name) : "Diễn đàn, hỏi đáp về quà tặng, quà sinh nhật, quà cưới, tân gia, gói quà, tặng quà"%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="question">
     <h2><%=Model.Category!=null? Html.Encode(Model.Category.Name): "Hỏi đáp" %></h2>
     <div class="line"></div>
     <ul>
        <% if (Model.Questions != null && Model.Questions.Count() > 0)
           {
               foreach (var q in Model.Questions)
               {
        %>
        <li class="line_dot line_vip">
            <div style="display: block; overflow: hidden;">
                <div class="intro">
                    <h3>
                        <a title="<%= q.Title %>" href="/question/details/<%= q.ID %>"><span class="name">
                            <%= q.Title %></span> </a>
                    </h3>
                    <div class="content">
                        <span class="author">Người gửi: <strong><%= q.AddBy.HasValue? q.aspnet_User.UserName:q.SendBy %></strong> | Thời gian gửi:
                            <%= q.AddDate %></span> 
                        <span class="mores">Trong: <a href="/question/index/<%=q.CatID %>" style="color: #1C7B9B;"><%= q.CatID.HasValue ? q.QuestionCategory.Name:"Khác" %></a> </span>
                    </div>
                </div>
            </div>
            <div class="listdetail">
                <h4>
                    <label>
                        Nội dung:
                    </label>
                </h4>
                <span id="listcontent">
                    <p>
                        <%= q.QuestionContent %></p>
                </span><span class="reply"><a title="Trả lời câu hỏi" href="/question/details/<%= q.ID %>" style="color: #1C7B9B;">
                    Trả lời câu hỏi</a> </span>
            </div>
        </li>
        <%}
           } %>
    </ul>
    <div class="pagebarUTH f_r">
        <%= Html.Pager(Model.Questions.PageSize, Model.Questions.PageNumber, Model.Questions.TotalItemCount)%>
    </div>
</div>
    
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="RightContent" runat="server">
    <% Html.RenderAction("Lasted", "QuestionCategory", new {id= Model.Category!=null? Model.Category.ID:0, title = "Chuyên mục hỏi đáp" }); %>
    <% Html.RenderAction("Lasted", "Question", new {catid=Model.Category!=null? Model.Category.ID:0, title = "Hỏi đáp được quan tâm" }); %>
    <% Html.RenderAction("Newsest", "Question", new {catid=Model.Category!=null? Model.Category.ID:0, title = "Hỏi đáp mới nhất" }); %>
    
</asp:Content>

